﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Messages.aspx.cs" Inherits="FEIStorageSite.Messages" MasterPageFile="~/MasterPage.Master" %>
<%@ MasterType VirtualPath="~/MasterPage.Master" %>
<%@ Register Assembly="MSCaptcha"  Namespace="MSCaptcha" TagPrefix="cc1" %>

<asp:Content ID="messagesContent" ContentPlaceHolderID="contentPanel" runat="server">
    <asp:Label ID="messagesPageTitle" CssClass="title" runat="server"><h3>Повідомлення</h3></asp:Label>    
    <asp:Label ID="error" CssClass="error" runat="server"></asp:Label>
    
    <table cellpadding="0" cellspacing="10" class="upload_table" id="postMessageTable" runat="server">
        <tr>
            <td class="upload_table_header"><asp:Label ID="authorNameLabel" runat="server">Ваше ім'я: </asp:Label></td>
            <td><asp:TextBox ID="authorNameTextBox" CssClass="name_text_box" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <td class="upload_table_header"><asp:Label ID="messageLabel" runat="server">Повідомлення: </asp:Label></td>
            <td><asp:TextBox TextMode="MultiLine" Columns="30" Rows="6" ID="messageTextBox" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <td><cc1:CaptchaControl ID="messageCaptcha" runat="server" CaptchaBackgroundNoise="Medium" CaptchaLength="5" CaptchaHeight="35" CaptchaWidth="110" CaptchaLineNoise="Medium" CaptchaMinTimeout="5" CaptchaMaxTimeout="600" /></td>
            <td><asp:TextBox ID="captchaTextBox" runat="server" ></asp:TextBox></td>
        </tr>
        <tr>
            <td colspan="2" class="upload_table_button"><asp:Button ID="submitMessageButton" runat="server" Text="Залишити повідомлення" OnClick="MessageButtonClick" /></td>
        </tr>        
    </table>
        
    <div class="post_message_button">
        <asp:Label ID="postMessageButton" runat="server"><a href="Messages.aspx?action=post_message" onfocus="this.blur()">Залишити повідомлення</a></asp:Label>
    </div>
    
    <div class="pages">
        <asp:DataPager ID="messagesDataPager" PageSize="10" runat="server" OnPreRender="MessagesDataPagerPreRender" PagedControlID="messagesListView">
            <Fields>       
                <asp:TemplatePagerField>
                    <PagerTemplate>
                        <span>Сторінки: </span>
                    </PagerTemplate>
                </asp:TemplatePagerField>
                <asp:NumericPagerField ButtonCount="10" NextPageText="..." PreviousPageText="..." />
            </Fields>
        </asp:DataPager>
    </div>
    <asp:ListView ID="messagesListView" runat="server">
        <LayoutTemplate>
            <div class="messages_container">
                <dl id="itemPlaceholder" runat="server"></dl>
            </div>
        </LayoutTemplate>
        <ItemTemplate>
            <dl>
                <dt><%#Eval("AuthorName")%> <span class="messages_date">(Відправлено: <%#Eval("Date")%>)</span></dt>
                <dd><%#Eval("MessageText")%></dd>
            </dl>
        </ItemTemplate>
    </asp:ListView>   
</asp:Content>